<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="utf-8" />
</head>
<body>
<div th:fragment="header">
    <div class="row">
        <nav class="navbar navbar-inverse" style="height: 100%" role="navigation">
            <div class="col-md-6 col-xs-6" >
                <ul class="nav navbar-nav pull-left" style="width: 100%">
                    <li><a class="navbar-brand" href="home">租房系统</a></li>
                    <li><a class="navbar-brand" href="#">业主</a></li>
                </ul>
            </div>
            <div class="col-md-6 col-xs-6">
                <ul class="nav navbar-nav pull-right" style="width: 100%;">
                    <li class="pull-right">
                        <a href="logout" class="navbar-brand" style="font-size: 15px">退出</a>
                    </li>
                    <li class="pull-right">
                        <a href="/showMyOrder" class="navbar-brand" style="font-size: 15px">我的订单</a>
                    </li>
                    <li class="pull-right">
                        <a href="showUserInformation" class="thumbnail" style="padding: 3px;margin: 3px;height: 45px;width: 45px">
                            <img id="avatar-small" style="width: 100%;height: 100%;" src=""/>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            $.ajax({
                type: 'get',
                url: 'fun',
                success: function (data) {
                    if (data == null || data == "") {
                        $("#avatar-small").attr("src", "../imgs/null-avatar.jpg");
                    } else {
                        $("#avatar-small").attr("src", data);
                    }

                    console.log(data);
                },
                complete: function (XMLHttpRequest, textStatus) {

                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    // 状态码
                    console.log(XMLHttpRequest.status);
                    // 状态
                    console.log(XMLHttpRequest.readyState);
                    // 错误信息
                    console.log(textStatus);
                }
            });
        });
    </script>
</div>
</body>
</html>